package com.zzyl.nursing.helper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author byZhao
 * @create 2025/6/26 18:26
 * @description
 */
@Component
public class FileContent2RedisHelper {

    @Autowired
    private StringRedisTemplate redis;

    @Async
    public void readContent2Redis(String redisKey,String value){
        System.out.println("=========="+Thread.currentThread().getName()+"=============");
        redis.opsForValue().set(redisKey,value,15, TimeUnit.DAYS);
    }


}
